<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p >你好啊</p>
    <script>
        function rbg(){
            let r=Math.floor(Math.random()*256);
            let g=Math.floor(Math.random()*256);
            let b=Math.floor(Math.random()*256);
           let a= `rgb(${r},${g},${b})`
      document.querySelector("p").style.background=a    
      setTimeout(rbg,1000)
        }
        rbg()
    </script>
</body>
</html>